/*
 * FileName: DataController.java
 * Author:   zzw
 * Date:     2018年05月24日
 * Description:
 */
package com.chezhibao.trace.controller;

import com.chezhibao.trace.service.DataService;
import com.chezhibao.trace.vo.ManyNodeTree;
import com.chezhibao.trace.vo.Message;
import com.chezhibao.trace.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 〈〉<br>
 * 〈〉
 *
 * @author zzw
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本]（可选）
 */
@RestController
@CrossOrigin(origins = "*")
public class DataController {

    @Autowired
    private DataService dataService;

    @GetMapping("/trace/data/{traceId}")
    public ResultVo<ManyNodeTree> getData(@PathVariable("traceId") String traceId){
        ManyNodeTree tree = dataService.getAll(traceId);
        ResultVo<ManyNodeTree> messageResultVo = new ResultVo<>(tree,"200",true);
        return messageResultVo;
    }
}
